package com.champrin.replicationofmyblockapix.mysql;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class MySQLUtils {
    private final static String DRIVER = "com.mysql.jdbc.Driver";
//    private final static String IP = "10.33.73.41";
    private final static String IP = "124.222.243.40";
    private final static String PORT = "3306";
//    private final static String DATABASE_NAME = "game";
    private final static String DATABASE_NAME = "demo";
    private final static String URL = "jdbc:mysql://" + IP + ":" + PORT + "/" + DATABASE_NAME + "?useUnicode=true&characterEncoding=utf-8&useSSL=false";
    private final static String USERNAME = "demo";
    private final static String PASSWORD = "demodemo";

    static {
        try {
            Class.forName(DRIVER);
        } catch (ClassNotFoundException ignored) {
        }
    }

    public static Connection getConnect() {
        Connection connection = null;
        try {
            connection = DriverManager.getConnection(URL, USERNAME, PASSWORD);
        } catch (SQLException ignored) {
        }
        return connection;
    }

}
